Method and Apparatus for Preparing Image on Cloud Platform, and Device and Storage Medium

ABSTRACT

A method and apparatus for preparing an image on a cloud platform, and a device and a storage medium are provided. The method may include: receiving an image request for a target object, and obtaining a first storage backend of the target object according to the image request (S 100 ); obtaining a second storage backend of a Glance service in the cloud platform, and comparing the second storage backend with the first storage backend (S 200 ); and obtaining an image for the target object on the second storage backend in a cloning manner when the first storage backend is the same as the second storage backend (S 300 ). According to the method, the first storage backend of the target object is obtained according to the received image request, and the second storage backend of the Glance service in the cloud platform is obtained. When the first storage backend is the same as the second storage backend, the image for the target object is obtained on the second storage backend in the cloning manner, so that the downloading and uploading processes are omitted, the time for preparing the image may be greatly shortened, a bandwidth load of a service network may also be reduced, and the efficiency of image preparing may be remarkably improved.

CROSS-REFERENCE TO RELATED APPLICATION

The present disclosure claims priority to China Patent Application No.202011182679.2, filed on Oct. 29, 2020 in China National IntellectualProperty Administration and entitled “METHOD AND APPARATUS FOR PREPARINGIMAGE ON CLOUD PLATFORM, AND DEVICE AND STORAGE MEDIUM”, which is herebyincorporated by reference in its entirety.

TECHNICAL FIELD

The present disclosure relates to the technical field of cloudplatforms, in particular, to a method and apparatus for preparing animage on a cloud platform, and a computer device and a storage medium.

BACKGROUND

On a cloud platform based on multiple architectures, Glance is animportant component in OpenStack, and provides image (also referred toas mirror) storage services for OpenStack. With the help of Glance, whena cloud host or a system disk is created, a system image may beconveniently provided. On an operating system of the cloud platform, auser may conveniently upload an image through the Glance service, andthe image will be finally stored on a corresponding storage backendthrough a driver for future use by the user. The image may be used forcreating a cloud host.

At present, there are usually two methods for preparing an image on acloud platform. The first method is to directly start a cloud hostthrough an image. The second method is to download an image to a cloudhard disk which is used as a system disk to directly start a cloud host.In a case where a cloud host is created by using either of the above twomethods, after a user uses the cloud host for a period of time andinstalls many other programs based on the image, the user may intend toprepare a new image through the current cloud host or system disk forlater use. On a current cloud platform, if a cloud host is started by acloud hard disk, an image may be directly exported based on a systemdisk, but this operation requires a long time even if the system diskand the image storage backend are located in the same bottom layerstorage. This long time is caused by the following complicated process:cinder-volume (Cinder is a service that provides block storage in thecloud platform (such as OpenStack), and various relevant drives of atarget storage platform is installed in a cinder-volume container, sothat the configuration of the architecture is optimized) invokes abottom-layer storage drive corresponding to the system disk, data of thesystem disk needs to be completely downloaded to a temporary folder on acinder-volume host machine of the cloud platform, the system disk isthen uploaded to a glance storage backend through a glance RESTApplication Programming Interface (API) (which is an interface of aGLANCE service), and temporary files are then deleted. If a cloud hostis started by an image, the image needs to be completely downloaded to atemporary folder on a nova-compute (a portal for managing andconfiguring virtual machines) host machine, then the temporary image isuploaded to a glance storage back end through a glance REST API, andthen the temporary image is deleted. It may be seen that the processesof the above two methods for preparing the image are extremelycumbersome and complex, and downloading and uploading operations arevery time-consuming, and the efficiency of image preparing is low.

SUMMARY

In view of this, it is necessary to provide a method and apparatus forpreparing an image on a cloud platform, and a computer device and astorage medium, which may reduce downloading and uploading time andimprove the efficiency of an image preparing service.

According to a first aspect of the embodiments of the presentdisclosure, a method for preparing an image on a cloud platform isprovided, including:

-   -   receiving an image request for a target object, and obtaining a        first storage backend of the target object according to the        image request;    -   obtaining a second storage backend of a Glance service in the        cloud platform, and comparing the second storage backend with        the first storage backend; and    -   obtaining an image for the target object on the second storage        backend in a cloning manner when the first storage backend is        the same as the second storage backend.

In some embodiments, the method may further include:

-   -   parsing a storage pool corresponding to the second storage        backend; and    -   obtaining a usage status of the target object;    -   wherein obtaining the image for the target object on the second        storage backend in the cloning manner when the first storage        backend is the same as the second storage backend may include:        when the first storage backend is the same as the second storage        backend, and the target object is in a non-used state, obtaining        the image for the target object on the second storage backend in        the cloning manner; and when the first storage backend is the        same as the second storage backend, and the target object is in        a used state, snapshooting the target object on the second        storage backend, and obtaining, after the snapshooting is        completed, the image for the target object in the cloning        manner.

In some embodiments, the operation of obtaining the image for the targetobject on the second storage backend in the cloning manner may include:

-   -   cloning the target object to the storage pool corresponding to        the second storage backend to obtain a target image, and        flattening the target image; and    -   updating metadata of the target image after flattening, to        obtain the image for the target object.

In some embodiments, the target object is a system disk; and theoperation of receiving the image request for the target object, andobtaining the first storage backend of the target object according tothe image request may include:

-   -   receiving an image creation request for the system disk via a        Cinder service interface in the cloud platform; and    -   sending a message to a storage backend of the system disk to        obtain a bottom-layer storage backend of the system disk, and        determining the bottom-layer storage backend of the system disk        as the first storage backend.

In some embodiments, the target object is a cloud host; and theoperation of receiving the image request for the target object, andobtaining the first storage backend of the target object according tothe image request may include:

-   -   receiving an image creation request for the cloud host via a        Nova service interface in the cloud platform; and    -   querying a database for a position of the cloud host, and        parsing the location of the cloud host to obtain a bottom-layer        storage backend of the cloud host, and determining the        bottom-layer storage backend of the cloud host as the first        storage backend.

In some embodiments, the operation of obtaining the second storagebackend of the Glance service in the cloud platform may include:

-   -   invoking an interface of the Glance service in the cloud        platform, and reading a storage configuration of the Glance        service to obtain an image location; and    -   parsing the image location to obtain image backend port        information, and determining the second storage backend        according to the image backend port information.

In some embodiments, the method may further include:

-   -   obtaining, when the first storage backend is different from the        second storage backend, an image for the target object by        downloading the target object to the cloud platform; and    -   invoking an interface of the Glance service of the cloud        platform to upload the image for the target object in the cloud        platform to the second storage backend.

According to a second aspect of the embodiments of the presentdisclosure, an apparatus for preparing an image on a cloud platform isprovided, including:

-   -   a first storage backend obtaining module, configured to receive        an image request for a target object, and obtain a first storage        backend of the target object according to the image request;    -   a second storage backend obtaining module, configured to obtain        a second storage backend of a Glance service in the cloud        platform, and compare the second storage backend with the first        storage backend; and    -   a cloning module, configured to obtain an image for the target        object on the second storage backend in a cloning manner when        the first storage backend is the same as the second storage        backend.

According to a third aspect of the embodiments of the presentdisclosure, a computer device is further provided. The computer devicemay include:

-   -   at least one processor; and    -   a memory, storing a computer program operable on the processor,        the processor, when executing the program, implementing the        foregoing method for preparing an image on a cloud platform.

According to a fourth aspect of the embodiments of the presentdisclosure, a computer-readable storage medium is further provided. Thecomputer-readable storage medium stores a computer program which, whenexecuted by a processor, implements the foregoing method for preparingan image on a cloud platform.

According to the method for preparing an image on a cloud platform, thefirst storage backend of the target object is obtained according to thereceived image request, and the second storage backend of the Glanceservice in the cloud platform is obtained. When the first storagebackend is the same as the second storage backend, the image for thetarget object is obtained on the second storage backend in the cloningmanner, so that the downloading and uploading processes are omitted, thetime for preparing the image may be greatly shortened, a bandwidth loadof a service network may also be reduced, and the efficiency of imagepreparing may be remarkably improved.

In addition, the embodiments of the present disclosure provide anapparatus for preparing an image on a cloud platform, a computer deviceand a computer-readable storage medium, which may also achieve the abovetechnical effect. This will not be repeated here again.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the embodiments of the present disclosure or thetechnical solutions in the related art more clearly, drawings requiredto be used in the embodiments or the illustration of the related artwill be briefly introduced below. Obviously, the drawings in theillustration below are only some embodiments of the present disclosure.Those having ordinary skill in the art also may acquire otherembodiments according to these drawings without creative effort.

FIG. 1 is a flow diagram of a method for preparing an image on a cloudplatform according to some embodiments of the present disclosure;

FIG. 2 is a flow diagram of preparing an image for a system diskaccording to some embodiments of the present disclosure;

FIG. 3 is a flow diagram of preparing an image for a cloud hostaccording to some embodiments of the present disclosure;

FIG. 4 is a schematic structural diagram of an apparatus for preparingan image on a cloud platform according to some embodiments of thepresent disclosure;

FIG. 5 is a diagram of an internal structure of a computer deviceaccording to some embodiments of the present disclosure; and

FIG. 6 is a schematic diagram of a computer-readable storage mediumaccording to some embodiments of the present disclosure.

DETAILED DESCRIPTION

To make the objectives, technical solutions and advantages of thepresent disclosure clearer, embodiments of the present disclosure arefurther described below in detail in combination with exemplaryembodiments and with reference to accompanying drawings.

It should be noted that all the expressions of “first” and “second” inthe embodiments of the present disclosure are used to distinguish twodifferent entities with same names or two different parameters. It maybe seen that “first” and “second” are only for the convenience ofexpression, and should not be understood as limiting the embodiments ofthe present disclosure. The subsequent embodiments will not providerepeated explanation at each occurrence of such expressions.

In some embodiments, FIG. 1 shows a flow diagram of a method forpreparing an image on a cloud platform. According to the method forpreparing an image on a cloud platform of the embodiments of the presentdisclosure, the cloud platform is based on multiple architectures. Thecloud platform achieves unified management and scheduling of variousvirtualizations on X86 and ARM architectures among different hardwarearchitectures by using a computing service. In the embodiments, themethod may include the following operations S100 to S300.

At S100, an image request for a target object is received, and a firststorage backend of the target object is obtained according to the imagerequest.

At S200, a second storage backend of a Glance service in the cloudplatform is obtained, and the second storage backend is compared withthe first storage backend.

Glance is an important component in OpenStack. It provides image storageservices for OpenStack. When a cloud host or a system disk is created, asystem image may be conveniently provided. A Glance-API is extended forthe Glance service to provide a new interface, i.e., a get_store_cfginterface. An image location is obtained by reading a glance-store(image storage) configuration, and the image location is parsed toobtain relevant information of an image backend, such as host, fsid andpools.

S300, an image for the target object is obtained on the second storagebackend in a cloning manner when the first storage backend is the sameas the second storage backend.

According to the method for preparing an image on a cloud platform, thefirst storage backend of the target object is obtained according to thereceived image request, and the second storage backend of the Glanceservice in the cloud platform is obtained. When the first storagebackend is the same as the second storage backend, the image for thetarget object is obtained on the second storage backend in the cloningmanner, so that the downloading and uploading processes are omitted, thetime for preparing the image may be greatly shortened, a bandwidth loadof a service network may also be reduced, and the efficiency of imagepreparing may be remarkably improved.

In some exemplary embodiments, the method for preparing an image on acloud platform provided in the present disclosure may further includethe following operations.

At S410, a storage pool corresponding to the second storage backend isparsed.

At S420, a usage status of the target object is obtained.

The operation S300 in which the image for the target object is obtainedon the second storage backend in the cloning manner when the firststorage backend is the same as the second storage backend may furtherinclude following operations S430 and S440.

At S430, when the first storage backend is the same as the secondstorage backend, and the target object is in a non-used state, the imagefor the target object is obtained on the second storage backend in thecloning manner.

At S440, when the first storage backend is the same as the secondstorage backend, and the target object is in a used state, the targetobject is snapshot on the second storage backend, and the image for thetarget object is obtained in the cloning manner after the snapshootingis completed.

In some exemplary embodiments, the foregoing operation S300 may includethe following sub-operations S310 and S320.

At S310, the target object is cloned to the storage pool correspondingto the second storage backend to obtain a target image, and the targetimage is flattened.

At S320, metadata of the target image after flattening is updated, toobtain the image for the target object.

In some exemplary embodiments, the target object is a system disk; andthe operation S100 may include following operations S110A and S120A.

At S110A, an image creation request for the system disk is received viaa Cinder service interface in the cloud platform, where Cinder is aservice that provides block storage in the cloud platform (such asOpenStack).

At S120A, a message is sent to a storage backend of the system disk toobtain a bottom-layer storage backend of the system disk, and thebottom-layer storage backend of the system disk is determined as thefirst storage backend.

In some exemplary embodiments, the target object is a cloud host, andthe operation S100 may include following operations S110B and S120B.

At S110B, an image creation request for the cloud host is received via aNova service interface in the cloud platform, where Nova is a servicethat provides computation in The cloud platform (such as OpenStack).

At S120B, a database is queried for a location of the cloud host, andthe location of the cloud host is parsed to obtain a bottom-layerstorage backend of the cloud host; and the bottom-layer storage backendof the cloud host is determined as the first storage backend.

In some exemplary embodiments, the foregoing operation S200 may includethe following sub-operations S210 and S220.

At S210, an interface of the Glance service in the cloud platform isinvoked, and a storage configuration of the Glance service is read toobtain an image location.

At S220, the image location is parsed to obtain image backend portinformation, and the second storage backend is determined according tothe image backend port information.

In some exemplary embodiments, the method for preparing an image on acloud platform based on the foregoing embodiment may further include thefollowing operations S510 and S520.

At S510, when the first storage backend is different from the secondstorage backend, an image for the target object is obtained bydownloading the target object to the cloud platform.

At S520, an interface of the Glance service of the cloud platform isinvoked to upload the image for the target object in the cloud platformto the second storage backend.

In some other exemplary embodiments, FIG. 2 shows a flow diagram ofpreparing an image for a system disk. In order to facilitateunderstanding the technical solution of the embodiments of the presentdisclosure, an example in which the system disk is used as the targetobject is described below. The method for preparing the image for thesystem disk may include the following operations A1 to A4.

At A1, a Glance-API is extended so as to provide a new interface, i.e.,a get_store_cfg interface; an image location is obtained by reading aglance-store (image storage) configuration, and the image location isparsed to obtain relevant information of an image backend, such as host,fsid and pools.

At A2, a Cinder-API receives an image preparing request, obtains abottom-layer storage backend (backend_name) corresponding to the systemdisk, and then invokes an interface copy_volume_to_image of acorresponding driver, to obtain a system disk backend.

At A3, an image backend location is obtained by invoking the Glance-APIextended in operation A1.

At A4, the image backend location obtained in operation A3 is comparedwith the system disk backend obtained in operation A2, and an image isprepared according to a comparison result which may include thefollowing three specific cases. In the first case, the backend obtainedin operation A2 and the backend obtained in operation A3 are the samebackend, and the system disk is in use, a snapshot for the system diskin use is first obtained and then protected, the system disk is clonedto the image, the image is then flattened, and finally, the imagelocation and the metadata are updated. In the second case, the backendobtained in operation A2 and the backend obtained in operation A3 arethe same backend, and the system disk is not in use at present, thesystem disk is directly cloned to the image, the image is thenflattened, and the image location and the metadata are then updated. Inthe third case, the backend obtained in operation A2 and the backendobtained in operation A3 are different backends, data of the system diskis downloaded to a local of the cloud platform, and the interface(Glance-API) of the Glance service is invoked to upload the image of thelocal of the cloud platform to a Glance service backend.

In some other exemplary embodiments, FIG. 3 shows a flow diagram ofpreparing an image for a cloud host. In order to facilitateunderstanding the technical solution of the present disclosure, anexample in which the cloud host is used as the target object isdescribed below. The method for preparing the image for the cloud hostmay include the following operations B1 to B3.

At B1, a Glance-API is extended so as to provide a new interface, i.e.,a get_store_cfg interface; an image location is obtained by reading aglance-store (image storage) configuration, and the image location isparsed to obtain relevant information of an image backend, such as host,fsid and pools.

At B2, a Novaf service interface (Nova-API) receives an image preparingrequest, and obtains a bottom-layer storage backend (backend_name)corresponding to the image of the cloud host and a storage pool, toobtain a cloud host backend.

A Cinder-API receives an image preparing request, obtains a bottom-layerstorage backend (backend_name) corresponding to the system disk, andthen invokes an interface copy_volume_to_image of a correspondingdriver.

At B3, a Nova service obtains an image backend location through theextended Glance interface.

At B4, the image backend location obtained in operation B3 is comparedwith the cloud host backend obtained in operation B2, and an image isprepared according to a comparison result which may include thefollowing three specific cases. In the first case, the backend obtainedin operation B2 and the backend obtained in operation B3 are the samebackend, and the cloud host is running, a snapshot for the cloud hostthat is running is first obtained and then protected, the cloud host iscloned to the image, the image is then flattened, and finally, the imagelocation and the metadata are updated. In the second case, the backendobtained in operation B2 and the backend obtained in operation B3 arethe same backend, and the cloud host is not running at present, thecloud host is directly cloned to the image, the image is then flattened,and the image location and the metadata are then updated. In the thirdcase, the backend obtained in operation B2 and the backend obtained inoperation B3 are different backends, data of the cloud host isdownloaded to a local of the cloud platform, and the interface(Glance-API) of the Glance service is invoked to upload the image of thelocal of the cloud platform to a Glance service backend.

The above method for preparing an image on a cloud platform extends theGlance service interface, so that for different target objects, when atarget object storage backend and a storage backend of a Glance serviceare the same, the time of downloading and uploading for image preparingwithin the platform may be reduced, a bandwidth of a service network maybe saved, and the service efficiency may be improved.

In some other exemplary embodiments, as shown in FIG. 4 , an apparatus60 for preparing an image on a cloud platform includes:

-   -   a first storage backend obtaining module 61, configured to        receive an image request for a target object, and obtain a first        storage backend of the target object according to the image        request;    -   a second storage backend obtaining module 62, configured to        obtain a second storage backend of a Glance service in the cloud        platform, and compare the second storage backend with the first        storage backend; and    -   a cloning module 63, configured to obtain an image for the        target object on the second storage backend in a cloning manner        when the first storage backend is the same as the second storage        backend.

It should be noted that for further exemplary implementations on theapparatus for preparing an image on a cloud platform, reference could bemade to the above method for preparing an image on a cloud platform. Thevarious modules in the apparatus for preparing an image on a cloudplatform may be realized in whole or in part by software, hardware and acombination of software and hardware. The above modules may be embeddedin or independent of a processor in a computer device in the form ofhardware, or may be stored in a memory in the computer device in theform of software, so that it is convenient for the processor to invokeand execute operations corresponding to the above modules.

According to another aspect of the embodiments of the presentdisclosure, a computer device is provided. The computer device may be aserver. FIG. 5 shows a diagram of an internal structure of the computerdevice. The computer device may include a processor, a memory, a networkinterface and a database which are connected through a system bus. Theprocessor of the computer device is configured to provide computing andcontrol capabilities. The memory of the computer device may include anonvolatile storage medium and an internal memory. The nonvolatilestorage medium stores an operating system, a computer program and adatabase. The internal memory provides an environment for running of theoperating system and a computer program in the nonvolatile storagemedium. The database of the computer device is configured to store data.The network interface of the computer device is used for communicatingwith an external terminal through network connection. The computerprogram, when executed by the processor, implements the method forpreparing an image on a cloud platform.

According to still another aspect of the embodiments of the presentdisclosure, a computer-readable storage medium is provided. Referring toFIG. 6 , the computer-readable storage medium stores a computer program.The computer program, when executed by the processor, implements themethod for preparing an image on a cloud platform.

Those having ordinary skill in the art can understand thatimplementation of all or a part of the processes in the method of theforegoing embodiment may be completed by a computer program thatinstructs relevant hardware. The computer program may be stored in anonvolatile computer-readable storage medium. The computer program mayinclude the processes of the embodiments of the foregoing methods whenexecuted. Any reference to the memory, the storage, the database orother media used in the embodiments provided by the present disclosuremay include nonvolatile and/or volatile memories. The nonvolatilememories may include a read-only memory (ROM), a programmable ROM(PROM), an electrically programmable ROM (EPROM), an electricallyerasable programmable ROM (EEPROM) or a flash memory. The volatilememories may include a random access memory (RAM) or an external cache.As an illustration but not a limitation, the RAM is available in manyforms, such as a static RAM (SRAM), a dynamic RAM (DRAM), a synchronousDRAM (SDRAM), a double data rate SDRAM (DDRSDRAM), an enhanced SDRAM(ESDRAM), a synchlink DRAM (SLDRAM), a Rambus direct RAM (RDRAM), adirect memory bus dynamic RAM (DRDRAM), and a memory bus dynamic RAM(RDRAM).

The technical features of the embodiments described above may bearbitrarily combined. In order to make the description concise, allpossible combinations of various technical features in the aboveembodiments are not completely described. However, the combinations ofthese technical features should be considered as the scope described inthe present specification as long as there is no conflict.

The above embodiments only express several implementations of thepresent disclosure, and their descriptions are more specific anddetailed, but they cannot be understood as limiting the patent scope ofthe invention. It should be noted that those having ordinary skill inthe art may further make variations and improvements without departingfrom the conception of the present disclosure, and these variations andimprovements all fall within the protection scope of the presentdisclosure. Therefore, the patent protection scope of the presentdisclosure should be subject to the appended claims.

1. A method for preparing an image on a cloud platform, comprising:receiving an image request for a target object, and obtaining a firststorage backend of the target object according to the image request;obtaining a second storage backend of a Glance service in the cloudplatform, and comparing the second storage backend with the firststorage backend; and obtaining an image for the target object on thesecond storage backend in a cloning manner when the first storagebackend is the same as the second storage backend.
 2. The methodaccording to claim 1, further comprising: parsing a storage poolcorresponding to the second storage backend; and obtaining a usagestatus of the target object.
 3. The method according to claim 21,wherein obtaining the image for the target object on the second storagebackend in the cloning manner comprises: cloning the target object tothe storage pool corresponding to the second storage backend to obtain atarget image, and flattening the target image; and updating metadata ofthe target image after flattening, to obtain the image for the targetobject.
 4. The method according to claim 1, wherein the target object isa system disk; and receiving the image request for the target object,and obtaining the first storage backend of the target object accordingto the image request comprises: receiving an image creation request forthe system disk via a Cinder service interface in the cloud platform;and sending a message to a storage backend of the system disk to obtaina bottom-layer storage backend of the system disk, and determining thebottom-layer storage backend of the system disk as the first storagebackend.
 5. The method according to claim 1, wherein the target objectis a cloud host; and receiving the image request for the target object,and obtaining the first storage backend of the target object accordingto the image request comprises: receiving an image creation request forthe cloud host via a Nova service interface in the cloud platform; andquerying a database for a position of the cloud host, and parsing thelocation of the cloud host to obtain a bottom-layer storage backend ofthe cloud host, and determining the bottom-layer storage backend of thecloud host as the first storage backend.
 6. The method according toclaim 1, wherein obtaining the second storage backend of the Glanceservice in the cloud platform comprises: invoking an interface of theGlance service in the cloud platform, and reading a storageconfiguration of the Glance service to obtain an image location; andparsing the image location to obtain image backend port information, anddetermining the second storage backend according to the image backendport information.
 7. The method according to claim 1, furthercomprising: obtaining, when the first storage backend is different fromthe second storage backend, an image for the target object bydownloading the target object to the cloud platform; and invoking aninterface of the Glance service of the cloud platform to upload theimage for the target object in the cloud platform to the second storagebackend.
 8. (canceled)
 9. A computer device, comprising: at least oneprocessor; and a memory, the memory storing a computer program operablein the processor, and the processor, when executing the program, isconfigured to: receive an image request for a target object, and obtaina first storage backend of the target object according to the imagerequest; obtain a second storage backend of a Glance service in thecloud platform, and compare the second storage backend with the firststorage backend; and obtain an image for the target object on the secondstorage backend in a cloning manner when the first storage backend isthe same as the second storage backend.
 10. A non-transitorycomputer-readable storage medium, the computer-readable storage mediumstoring a computer program, wherein the computer program, when executedby a processor, causes the processor to: receive an image request for atarget object, and obtain a first storage backend of the target objectaccording to the image request; obtain a second storage backend of aGlance service in the cloud platform, and compare the second storagebackend with the first storage backend; and obtain an image for thetarget object on the second storage backend in a cloning manner when thefirst storage backend is the same as the second storage backend.
 11. Themethod according to claim 1, wherein the cloud platform is OpenStack;and the Glance service is used for providing image storage services forthe OpenStack.
 12. The method according to claim 6, wherein a Glance-APIis extended for the Glance service to provide the interface of theGlance service in the cloud platform.
 13. The method according to claim2, wherein obtaining the image for the target object on the secondstorage backend in the cloning manner when the first storage backend isthe same as the second storage backend comprises: when the first storagebackend is the same as the second storage backend, and the target objectis in a non-used state, obtaining the image for the target object on thesecond storage backend in the cloning manner; and when the first storagebackend is the same as the second storage backend, and the target objectis in a used state, snapshooting the target object on the second storagebackend, and obtaining, after the snapshooting is completed, the imagefor the target object in the cloning manner.
 14. The method according toclaim 13, wherein obtaining the image for the target object on thesecond storage backend in the cloning manner comprises: cloning thetarget object to the storage pool corresponding to the second storagebackend to obtain a target image, and flattening the target image; andupdating metadata of the target image after flattening, to obtain theimage for the target object.
 15. The computer device according to claim9, wherein the processor, when executing the program, is furtherconfigured to: parse a storage pool corresponding to the second storagebackend; and obtain a usage status of the target object.
 16. Thecomputer device according to claim 15, wherein the processor, whenobtaining the image for the target object on the second storage backendin the cloning manner when the first storage backend is the same as thesecond storage backend, is configured to: when the first storage backendis the same as the second storage backend, and the target object is in anon-used state, obtain the image for the target object on the secondstorage backend in the cloning manner; and when the first storagebackend is the same as the second storage backend, and the target objectis in a used state, snapshoot the target object on the second storagebackend, and obtain, after the snapshooting is completed, the image forthe target object in the cloning manner
 17. The computer deviceaccording to claim 9, wherein the processor, when obtaining the imagefor the target object on the second storage backend in the cloningmanner, is configured to: clone the target object to the storage poolcorresponding to the second storage backend to obtain a target image,and flatten the target image; and update metadata of the target imageafter flattening, to obtain the image for the target object.
 18. Thecomputer device according to claim 16, wherein the processor, whenobtaining the image for the target object on the second storage backendin the cloning manner, is configured to: clone the target object to thestorage pool corresponding to the second storage backend to obtain atarget image, and flatten the target image; and update metadata of thetarget image after flattening, to obtain the image for the targetobject.
 19. The computer device according to claim 9, wherein the targetobject is a system disk; and the processor, when receiving the imagerequest for the target object, and obtaining the first storage backendof the target object according to the image request, is configured to:receive an image creation request for the system disk via a Cinderservice interface in the cloud platform; and send a message to a storagebackend of the system disk to obtain a bottom-layer storage backend ofthe system disk, and determine the bottom-layer storage backend of thesystem disk as the first storage backend.
 20. The computer deviceaccording to claim 9, wherein the target object is a cloud host and theprocessor, when receiving the image request for the target object, andobtaining the first storage backend of the target object according tothe image request, is configured to: receive an image creation requestfor the cloud host via a Nova service interface in the cloud platform;and query a database for a position of the cloud host, and parse thelocation of the cloud host to obtain a bottom-layer storage backend ofthe cloud host, and determine the bottom-layer storage backend of thecloud host as the first storage backend.
 21. The computer deviceaccording to claim 9, wherein the processor, when obtaining the secondstorage backend of the Glance service in the cloud platform, isconfigured to: invoke an interface of the Glance service in the cloudplatform, and read a storage configuration of the Glance service toobtain an image location; and parse the image location to obtain imagebackend port information, and determine the second storage backendaccording to the image backend port information.